<template>
<view class='page-container'>
  <!-- 医疗专业人员信息卡片 -->
  <view class="info-card">
    <view class="info-row">
      <text class="info-label">所属医院</text>
      <text class="info-value">{{ userInfo.campusName }}</text>
    </view>
    <view class="info-row">
      <text class="info-label">就诊病区</text>
      <text class="info-value">{{ userInfo.deptName }}</text>
    </view>
    <view class="info-row">
      <text class="info-label">职称</text>
      <text class="info-value">{{ userInfo.jobTitle }}</text>
    </view>
  </view>

  <!-- 擅长专业输入区域 -->
  <view class="input-card">
    <text class="title-text">擅长</text>
    <view class="input-container">
      <textarea 
        class="input-textarea" 
        placeholder="请输入"
        v-model="userInfo.specialty"
        maxlength="200"
      ></textarea>
      <view class="char-count">{{ userInfo.specialty.length }}/200</view>
    </view>
  </view>

  <!-- 简介输入区域 -->
  <view class="input-card">
    <text class="title-text">简介</text>
    <view class="input-container">
      <textarea 
        class="input-textarea" 
        placeholder="请输入"
        v-model="userInfo.introduction"
        maxlength="200"
      ></textarea>
      <view class="char-count">{{ userInfo.introduction.length }}/200</view>
    </view>
  </view>

  <!-- 保存按钮 -->
   <view class="saveBtn" @click="handleSave">保存</view>
</view>
</template>

<script>
import { mapGetters } from "vuex";
export default {
  data() {
    return {
      specialties: '',
      introduction: '',
    }
  },
  computed: {
      ...mapGetters(['userInfo']),
  },
  methods: {
    handleSave() {
      saveForm = {
        id: this.userInfo.id,
        introduction: this.introduction,
      }
    },
  }
}
</script>

<style lang='scss' scoped>
.page-container {
  background: #f5f5f5;
  min-height: 100vh;
  padding: 24rpx 32rpx;
}

.info-card {
  background: linear-gradient(#EAF1FF 0%, #fff 50%);
  border-radius: 24rpx;
  padding: 8rpx 32rpx;
  margin-bottom: 32rpx;
  box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24rpx 0;
  border-bottom: 1rpx solid #f0f0f0;
  
  &:last-child {
    border-bottom: none;
  }
}

.info-label {
  font-size: 30rpx;
  color: #666;
}

.info-value {
  font-size: 30rpx;
  color: #333;
}

.input-card {
  background: #fff;
  border-radius: 16rpx;
  padding: 24rpx 32rpx;
  margin-bottom: 32rpx;
  box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
}

.title-text {
  font-size: 32rpx;
  color: #333;
  font-weight: 400;
  position: relative;
}

.title-text ::after {
    content: '';
	position: absolute;
	bottom: -8rpx;
	left: 0;
	width: 44rpx;
	height: 8rpx;
	background: linear-gradient(90deg, #41CFE6 0%, #14A5FF 100%);
	border-radius: 414rpx;
}

.input-container {
  position: relative;
  margin-top: 34rpx;
}

.input-textarea {
  width: 100%;
  min-height: 200rpx;
  background: #f8f8f8;
  border: none;
  border-radius: 12rpx;
  padding: 24rpx;
  font-size: 28rpx;
  color: #333;
  box-sizing: border-box;
  
  &::placeholder {
    color: #999;
  }
}

.char-count {
  position: absolute;
  bottom: 16rpx;
  right: 16rpx;
  font-size: 24rpx;
  color: #999;
}

.saveBtn {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: #1D77FF;
    color: #fff;
    font-size: 32rpx;
    font-weight: 600;
    height: 80rpx;
    border-radius: 200rpx;
}
</style>
